import 'package:flutter_app/generated/json/base/json_convert_content.dart';
import 'package:flutter_app/bean/update_app_entity.dart';

UpdateAppEntity $UpdateAppEntityFromJson(Map<String, dynamic> json) {
	final UpdateAppEntity updateAppEntity = UpdateAppEntity();
	final String? name = jsonConvert.convert<String>(json['name']);
	if (name != null) {
		updateAppEntity.name = name;
	}
	final String? version = jsonConvert.convert<String>(json['version']);
	if (version != null) {
		updateAppEntity.version = version;
	}
	final String? changelog = jsonConvert.convert<String>(json['changelog']);
	if (changelog != null) {
		updateAppEntity.changelog = changelog;
	}
	final String? versionShort = jsonConvert.convert<String>(json['versionShort']);
	if (versionShort != null) {
		updateAppEntity.versionShort = versionShort;
	}
	final String? build = jsonConvert.convert<String>(json['build']);
	if (build != null) {
		updateAppEntity.build = build;
	}
	final String? installUrl = jsonConvert.convert<String>(json['install_url']);
	if (installUrl != null) {
		updateAppEntity.installUrl = installUrl;
	}
	final String? updateUrl = jsonConvert.convert<String>(json['update_url']);
	if (updateUrl != null) {
		updateAppEntity.updateUrl = updateUrl;
	}
	final UpdateAppBinary? binary = jsonConvert.convert<UpdateAppBinary>(json['binary']);
	if (binary != null) {
		updateAppEntity.binary = binary;
	}
	return updateAppEntity;
}

Map<String, dynamic> $UpdateAppEntityToJson(UpdateAppEntity entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['name'] = entity.name;
	data['version'] = entity.version;
	data['changelog'] = entity.changelog;
	data['versionShort'] = entity.versionShort;
	data['build'] = entity.build;
	data['install_url'] = entity.installUrl;
	data['update_url'] = entity.updateUrl;
	data['binary'] = entity.binary?.toJson();
	return data;
}

UpdateAppBinary $UpdateAppBinaryFromJson(Map<String, dynamic> json) {
	final UpdateAppBinary updateAppBinary = UpdateAppBinary();
	final String? fsize = jsonConvert.convert<String>(json['fsize']);
	if (fsize != null) {
		updateAppBinary.fsize = fsize;
	}
	return updateAppBinary;
}

Map<String, dynamic> $UpdateAppBinaryToJson(UpdateAppBinary entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['fsize'] = entity.fsize;
	return data;
}